package com.tim.app.server.entry;

import android.text.TextUtils;

import com.tim.app.constant.AppKey;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 精选信息
 */

public class SelectInfo extends BaseObject{

    private String userId;

    private String discoverType;//对应内容的类型（ prbolem, answer, publish, story）
    private int problemId;//回答对应问题id answer对应prolem的id
    private String topicIds;//问题对应的话题ids
    private String topicId;
    private String content = "";//头图 封面
    private String audioUrl;//对应音频地址
    private String topicTitle = "";//话题名称
    private String problemTitle = "";//问题标题

    private String sort;//排序字段
    private int isHot;//是否是精选0不是 1是


    private List<Topic> subjectList;//话题列表

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getDiscoverType() {
        return discoverType;
    }

    public void setDiscoverType(String discoverType) {
        this.discoverType = discoverType;
    }

    public int getProblemId() {
        return problemId;
    }

    public void setProblemId(int problemId) {
        this.problemId = problemId;
    }

    public String getTopicIds() {
        return topicIds;
    }

    public String getTopicId() {
        return topicId;
    }

    public void setTopicId(String topicId) {
        this.topicId = topicId;
    }

    public void setTopicIds(String topicIds) {
        this.topicIds = topicIds;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAudioUrl() {
        return audioUrl;
    }

    public void setAudioUrl(String audioUrl) {
        this.audioUrl = audioUrl;
    }

    public String getTopicTitle() {
        return topicTitle;
    }

    public void setTopicTitle(String topicTitle) {
        this.topicTitle = topicTitle;
    }

    public String getProblemTitle() {
        return problemTitle;
    }

    public void setProblemTitle(String problemTitle) {
        this.problemTitle = problemTitle;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public int getIsHot() {
        return isHot;
    }

    public void setIsHot(int isHot) {
        this.isHot = isHot;
    }

    public List<Topic> getSubjectList() {
        return subjectList;
    }

    public void setSubjectList(List<Topic> subjectList) {
        this.subjectList = subjectList;
    }

    public List<String> getImageUrl() {
        if (!TextUtils.isEmpty(getImage())) {
            if (getImage().contains(AppKey.SEPARATOR)) {
                return Arrays.asList(getImage().split(AppKey.SEPARATOR));
            } else {
                List<String> list = new ArrayList<>();
                list.add(getImage());
                return list;
            }
        }
        return null;
    }
}
